<?php

declare (strict_types=1);

namespace App\Model;

use App\Library\Common;
use App\Model\Model;

/**
 * @property int $fileinfo_id
 * @property int $user_id
 * @property int $admin_id
 * @property string $url
 * @property string $imagewidth
 * @property string $imageheight
 * @property string $imagetype
 * @property int $filesize
 * @property string $mimetype
 * @property string $extparam
 * @property int $createtime
 * @property int $updatetime
 * @property int $uploadtime
 * @property string $storage
 * @property string $sha1
 */
class Fileinfo extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'fileinfo';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['fileinfo_id' => 'integer', 'user_id' => 'integer', 'admin_id' => 'integer', 'filesize' => 'integer', 'createtime' => 'integer', 'updatetime' => 'integer', 'uploadtime' => 'integer'];

    protected $primaryKey = 'fileinfo_id';

    /**
     * 获取完整路径.
     *
     * @param string $value
     * @return string
     * get驼峰字段名Attrbute
     */
    public function getUrlAttribute($value)
    {
        return Common::cdnurl($value);
    }

}